﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ComeSeeThis_MVC2.Models.GearingRecFormView>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Submit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Submit Gearing Recommendation</h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <table>
            <tr>
                <th>
                    Vehicle
                </th>
                <td>
                    <%: Html.DropDownListFor(m => m.GearingRec.VehicleId, Model.Vehicles, new { onchange = "SetVehicleTypeAndTransRatio(this)" })%>
                </td>
            </tr>
            <tr>
                <th>
                    Vehicle Type
                </th>
                <td>
                    <%: Html.DropDownListFor(m=> m.GearingRec.VehicleTypeId, Model.VehicleTypes) %>
                </td>
            </tr>
            <tr>
                <th>
                    Transmission Ratio
                </th>
                <td>
                    <input type="text" id="transmissionRatio" name="transmissionRatio" style="width: 40px" value="1" />
                </td>
            </tr>
            <tr>
                <th>
                    Pinion
                </th>
                <td>
                    <%: Html.TextBoxFor(x => x.GearingRec.Pinion, new { style = "width: 40px", onchange = "SetFdr()" })%>
                </td>
            </tr>
            <tr>
                <th>
                    Spur Gear
                </th>
                <td>
                    <%: Html.TextBoxFor(x => x.GearingRec.Spur, new { style = "width: 40px", onchange = "SetFdr()" })%>
                </td>
            </tr>
            <tr>
                <th>
                    FDR
                </th>
                <td>
                    <%: Html.TextBoxFor(x => x.GearingRec.FDR, new { style = "width: 40px" })%>
                    <%: Html.ValidationMessageFor(model => model.GearingRec.FDR) %>
                </td>
            </tr>
            <tr>
                <th>
                    Motor
                </th>
                <td>
                    <%: Html.DropDownListFor(m=>m.GearingRec.MotorId, Model.Motors) %>
                </td>
            </tr>
            <tr>
                <th>
                    ESC Timing Advanced Used
                </th>
                <td>
                    <%: Html.TextBoxFor(x => x.GearingRec.EscTimingAdvance, new { style = "width: 40px" })%>
                    degrees
                    <%: Html.ValidationMessageFor(model => model.GearingRec.EscTimingAdvance) %>
                </td>
            </tr>
            <tr>
                <th>
                    Average Motor Temp
                </th>
                <td>
                    <%: Html.TextBoxFor(x => x.GearingRec.MotorTemps, new { style = "width: 50px" })%>
                    degrees
                    <%: Html.ValidationMessageFor(model => model.GearingRec.MotorTemps) %>
                </td>
            </tr>
            <tr>
                <th>
                    Battery & Voltage
                </th>
                <td>
                    <table>
                        <tr>
                            <td>
                                Type:
                            </td>
                            <td>
                                Count:
                            </td>
                            <td>
                                Voltage
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Html.DropDownListFor(m=>m.GearingRec.CellTypeId, Model.CellTypes, new { onchange="UpdateVoltage()"}) %>
                            </td>
                            <td>
                                <select id="cellCount" name="cellCount" onchange="UpdateVoltage()">
                                    <option value="1">1</option>
                                    <option selected="selected" value="2">2</option>
                                    <option value="3">3</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                    <option value="6">6</option>
                                    <option value="7">7</option>
                                    <option value="8">8</option>
                                    <option value="9">9</option>
                                    <option value="10">10</option>
                                </select>
                            </td>
                            <td>
                                <input type="text" id="Voltage" name="Voltage" value="7.4" style="width: 40px" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <th>
                    Track Size
                </th>
                <th>
                    <%: Html.DropDownListFor(m=>m.GearingRec.TrackSizeId, Model.TrackSize) %>
                </th>
            </tr>
            <tr>
                <th>
                    Track Size
                </th>
                <th>
                    <%: Html.DropDownListFor(m=>m.GearingRec.TrackSurfaceId, Model.TrackSurface) %>
                </th>
            </tr>
        </table>
        <p>
            <input type="submit" value="Submit" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <script type="text/javascript">
    <% Response.Write(Model.VehicleTypeScript + "\n"); %>
    <% Response.Write(Model.TransRatioScript + "\n"); %>
    </script>
    <script src="../../Scripts/GearingRecFormStuff.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="BodyTagContent" runat="server">
</asp:Content>
